<template>
  <div>
    <!-- 轮播图 -->

    <div class="block">
      <el-carousel height="200px">
        <el-carousel-item v-for="item in bannerList" :key="item">
          <h3 class="small">{{ banners }}</h3>
        </el-carousel-item>
      </el-carousel>
    </div>
    <el-button @click="getList">Default</el-button>
    <p>{{ bannerList[0]}}</p>

    <audio
      controls
      src="https://music.163.com/song/media/outer/url?id=1815389717.mp3 "
    ></audio>
  </div>
</template>

<script>
import { request } from "../../api/request";
import axios from 'axios'

export default {
  data() {
    return {
      bannerList: [],
    };
  },
  methods: {
     getList() {
      // const { data: res } = await getListAPI();
      // console.log(res);
      // this.bannerList = res;
      // console.log(this.bannerList);
      // request('https://autumnfish.cn/banner',res=>{console.log(res);},err=>{console.log(err);})

      // const {data: res} = await request({
      //   url: "/api/banner",
      // })
      // console.log(res);
      // this.bannerList = res.banners
      axios.get('https://autumnfish.cn/api/banner').then(
        response=>{
          console.log(response.data);
        }
      )


    },
  },
};
</script>

<style scoped>
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>